package com.gmail.linuxpro13.iblocklog;

import com.gmail.linuxpro13.iblocklog.events.BlockDestroy;
import com.gmail.linuxpro13.iblocklog.events.BlockPlace;

import java.util.logging.Logger;
import java.util.logging.Level;

import org.bukkit.plugin.java.JavaPlugin;

public class iBlockLog extends JavaPlugin {

	private static final Logger l = Logger.getLogger("Minecraft");
	public int version = 1;
	public BlockDestroy blockdestroy = new BlockDestroy();
	public BlockPlace blockplace = new BlockPlace();
	
	@Override
	public void onDisable() {
		l.log(Level.INFO, "iBlockLog v" + version + " disabled!");
	}
	
	@Override
	public void onEnable() {
		l.log(Level.INFO, "iBlockLog v" + version + " enabled!");
		
		// register events
		
		l.log(Level.INFO, "Registering iBlockLog Events...50%");
		
		// register the block destroy
		getServer().getPluginManager().registerEvents(blockdestroy, this);
		
		l.log(Level.INFO, "Registering iBlockLog Events...100%");
		
		// register the block place
		getServer().getPluginManager().registerEvents(blockplace, this);
	}
	
	// APIs
	
	public iBlockLog getIBL() {
		return this;
	}
	
	public int getIBLVersion() {
		return this.version;
	}
}
